home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / emstools.arc / EMMLIB.ARC / EMM06_A.ASM < prev    next >
Assembly Source File  |  1990-02-04  |  4KB  |  78 lines

  1. ;-----------------------------------------------------------------------------;
  2. ;      MODULE NAME:   EMM06_A.ASM                                             ;
  3. ;                                                                             ;
  4. ;    FUNCTION NAME:   dealloc_pages                                           ;
  5. ;                                                                             ;
  6. ;      DESCRIPTION:   This function deallocates the logical pages currently   ;
  7. ;                     allocated to an EMM handle.  Only after the application ;
  8. ;                     deallocates these pages can other applications use      ;
  9. ;                     them.  When a handle is deallocated, its name is set to ;
  10. ;                     all ASCII nulls (binary zeros).                         ;
  11. ;                                                                             ;
  12. ;                     Note:                                                   ;
  13. ;                     A program must perform this function before it exits to ;
  14. ;                     DOS.  If it doesn't, no other programs can use these    ;
  15. ;                     pages or the EMM handle.  This means that a program     ;
  16. ;                     using expanded memory should trap critical errors and   ;
  17. ;                     control-break if there is a chance that the program     ;
  18. ;                     will have allocated pages when either of these events   ;
  19. ;                     occur.                                                  ;
  20. ;                                                                             ;
  21. ;           PASSED:   handle:                                                 ;
  22. ;                        is an open EMM handle.                               ;
  23. ;                                                                             ;
  24. ;         RETURNED:   status:                                                 ;
  25. ;                        is the status EMM returns from the call.  All other  ;
  26. ;                        returned results are valid only if the status        ;
  27. ;                        returned is zero.  Otherwise they are undefined.     ;
  28. ;                                                                             ;
  29. ; C USE CONVENTION:   unsigned int status;                                    ;
  30. ;                     unsigned int handle;                                    ;
  31. ;                                                                             ;
  32. ;                     status = dealloc_pages (handle);                        ;
  33. ;-----------------------------------------------------------------------------;
  34. .XLIST
  35. PAGE    60,132
  36.  
  37. IFDEF SMALL
  38.    .MODEL SMALL, C
  39. ENDIF
  40. IFDEF MEDIUM
  41.    .MODEL MEDIUM, C
  42. ENDIF
  43. IFDEF LARGE
  44.    .MODEL LARGE, C
  45. ENDIF
  46. IFDEF COMPACT
  47.    .MODEL COMPACT, C
  48. ENDIF
  49. IFDEF HUGE
  50.    .MODEL HUGE, C
  51. ENDIF
  52.  
  53. INCLUDE emmlib.equ
  54. INCLUDE emmlib.str
  55. INCLUDE emmlib.mac
  56. .LIST
  57. .CODE
  58.  
  59. dealloc_pages        PROC    handle:WORD
  60.  
  61.     ;---------------------------------------------------------------------;
  62.     ;   do;                                                               ;
  63.     ;   .   dealloc all pages allocated to the specified handle;          ;
  64.     ;---------------------------------------------------------------------;
  65.     MOVE        AH, dealloc_fcn
  66.     MOVE        DX, handle
  67.     INT         EMM_int
  68.  
  69.     ;---------------------------------------------------------------------;
  70.     ;   .   return (EMM status);                                          ;
  71.     ;   end;                                                              ;
  72.     ;---------------------------------------------------------------------;
  73.     RET_EMM_STAT    AH
  74.  
  75. dealloc_pages        ENDP
  76.  
  77. END
  78.